<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="UTF-8">
    <title>AI+应用设计创新大赛</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!--====== Favicon Icon ======-->
    <link rel="shortcut icon" href="/images/favicon.png" type="image/png">
    <!--====== Bootstrap CSS ======-->
    <link rel="stylesheet" href="/css/bootstrap.min.css">
    <!--====== default CSS ======-->
    <link rel="stylesheet" href="/css/default.css">
    <link rel="stylesheet" href="/font/bootstrap-icons.css">

    <link rel="stylesheet" href="/js/layui/css/layui.css">
    <!--====== Style CSS ======-->
    <link rel="stylesheet" href="/css/style.css">
    <style>
        #content{
            width: 100%;
            padding: 10px;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="row">
            <div class="layui-row" id="content">
            </div>
        </div>
    </div>

    <!--====== Jquery js ======-->
    <script src="/js/jquery-1.12.4.min.js"></script>
    <script src="/js/modernizr-3.7.1.min.js"></script>

    <!--====== Bootstrap js ======-->
    <script src="/js/bootstrap.min.js"></script>

    <script src="/js/sweetalert.min.js"></script>
    <script src="/js/jquery-validate.js"></script>

    <!--====== layerUI js ======-->
    <script src="/js/layui/layui.js"></script>

    <script src="/js/common.js"></script>
    <script type="text/javascript" th:inline="javascript">
        layui.use(function(){
            $.ajax({
                url: '/ground/list',
                type: 'GET',
                success: function (data) {
                    // 清空表格内容
                    $('#content').empty();
                    // 根据获取到的数据重新构建表格内容
                    let contentHtml = '';
                    data.data.forEach(function (info) {
                            contentHtml += '<div class="layui-col-md12" style="margin-bottom: 20px;">' +
                                '               <div class="layui-panel layui-bg-blue" onclick="ts(' + info.id + ')">' +
                                '                   <div style="padding: 30px;text-align: center;">' + info.name + '</div>' +
                                '</div></div>';
                    });
                    $('#content').html(contentHtml);
                },
                error: function (error) {
                    layer.msg('获取数据失败：' + error.responseText);
                }
            });
        });
        function ts(t){
            window.location.href = '/teamOrder/teamOrderUI?groundId='+t;
        }
    </script>
</body>
</html>
